/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Written (W) 2009 Soeren Sonnenburg
 * Copyright (C) 2009 Fraunhofer Institute FIRST and Max-Planck-Society
 */

#include <shogun/lib/common.h>
#include <shogun/base/class_list.h>
#include <string.h>

REPLACE includes THIS

using namespace shogun;

REPLACE definitions THIS

REPLACE template_definitions THIS

REPLACE complex_template_definitions THIS

typedef CSGObject* (*new_sgserializable_t)(EPrimitiveType generic);
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct
{
	const char* m_class_name;
	new_sgserializable_t m_new_sgserializable;
} class_list_entry_t;
#endif

static class_list_entry_t class_list[] = {
REPLACE struct THIS
	{NULL, NULL}
};

CSGObject* shogun::new_sgserializable(const char* sgserializable_name,
						   EPrimitiveType generic)
{
	for (class_list_entry_t* i=class_list; i->m_class_name != NULL;
		 i++)
	{
		if (strncmp(i->m_class_name, sgserializable_name, STRING_LEN) == 0)
			return i->m_new_sgserializable(generic);
	}

	return NULL;
}
